package com.woniuxy.opencv.controller;

import com.woniuxy.opencv.pojo.ResData;
import com.woniuxy.opencv.service.FaceRecognitionService;
import com.woniuxy.opencv.service.impl.LockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/room")
@CrossOrigin
public class LockController {

    @Autowired
    private LockService lockService;


    @PostMapping("/lock/{lockId}")
    public ResData lock(@PathVariable("lockId") Integer lockId) {
        // 2. 开锁
        return lockService.handleLockOperation(lockId);
    }
}
